﻿using System;
using System.Collections;
using System.Collections.Generic;
namespace WPFExcelReport
{
    public class EKLSReport : BaseReport
    {
        string strCompany = "HLT";
        string strExcelFile = "";
        public EKLSReport()
            : base()
        {
            AssignColumns();
        }
        public EKLSReport(Dictionary<string, object> dicParamater)
            : base(dicParamater)
        {
            strCompany = dicParamater["Company"].ToString().Trim();
            strExcelFile = dicParamater["ExcelFile"].ToString().Trim();
            AssignColumns();
        }
        private void AssignColumns()
        {
            columns.Clear();
            columns.Add("LIEFNR"); columns.Add("SUPPLIER"); columns.Add("QUANTITY"); columns.Add("VALUE");

        }

        public void REPORT2EXCEL(string fileType)
        {
            Queue CellQueue = new Queue();
            string filename = "";
            string sheetName = "";
            string Standard = "Purchase_PO_Summary";
            strExcelFile = @"HLT\HLTSummaryReport.xls";
            string filePath = @"C:\intex.w\Report\" + strExcelFile;
            exAgent.Open(filePath);
            exAgent.Company = "";
            exAgent.strExcelFile = strExcelFile;
            string filedate = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString();
            filename = @"Purchase\供应商采购量" + filedate + ".xls";
            sheetName = DateTime.Now.ToShortTimeString().Replace(@":", "");
            exAgent.CreateNewSheet(filename, Standard, sheetName);
            FillInData(columns, dsSource.Tables["PURCHASE_SUPP_SUMM"]);
            if (exAgent != null)
            {
                exAgent.Save();
                exAgent.Close();
            }
        }
    }
}


